﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TekaMUD.Engine.IO;

namespace TekaMUD.Engine.Blocks
{
	/// <summary>
	/// Main class for Goal-seaking, rational behaving agents (PC, NPC)
	/// </summary>
	[Serializable]
	public class RationalAgent : GameObject
	{
		public ObjectContainer Backpack { get; protected set; }
		public HealthData Health { get; set; }

		public RationalAgent()
		{
			Health = new HealthData(this);
		}
		
		public virtual Room Move(EnumDirectionType direction, out EnumMovementError error_type)
		{
			Room targetRoom = CurrentRoom.GetConnection(direction).End;

			error_type = EnumMovementError.Success;

			if (targetRoom == null)
			{
				return null;
			}

			return targetRoom;
		}
		public virtual Room CurrentRoom {get;set;}

		private BaseChannel _channel;
		public BaseChannel Channel
		{
			get
			{
				return _channel;
			}
			set
			{
				_channel = value;
			}
		}
	}
}
